<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>查看订单</title>
    <style>
        table {
            width: 80%;
            margin: 20px auto;
            border-collapse: collapse;
            font-family: Arial, sans-serif; /* 字体 */
        }

        th, td {
            border: 1px solid #ddd;
            padding: 10px;
            text-align: center; /* 中央对齐 */
        }

        th {
            background-color: #2196F3;
            color: white;
            font-weight: bold; /* 加粗 */
        }

        td {
            color: #555;
        }
    </style>
    </style>
</head>
<body>
    <div th:replace="head"></div>
    <div class="page-header">
        <div class="container">
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <div class="page-caption">
                        <h2 class="page-title">订单</h2>
                        <p>Healthy & delicious cuisine</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div>
        <table>
            <tr>
                <th>订单号</th>
                <th>订单状态</th>
                <th>订单价格</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
            <tr th:each="o:${orderList}">
                <td th:text="${o.order_id}"></td>
                <td th:switch="${o.order_status}">
                    <label th:case="0">未完成</label>
                    <label th:case="1">已支付</label>
                    <label th:case="2">已取消</label>
                </td>
                <td th:text="${o.order_price}"></td>
                <td th:text="${o.order_time}"></td>
                <td><a th:href="@{'/order/showdetail/'+${o.order_id}}">订单详情</a></td>
            </tr>
        </table>
    </div>
<a th:href="@{/user/tomain}">返回</a>
    <div th:replace="footer"></div>
</body>
</html>